package com.ten.order.controller;

import com.ten.common.core.entity.EduTeacher;
import com.ten.common.core.vo.Result;
import com.ten.order.service.ByTeacherNameService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：王薪伟
 * @date ：Created in 2022/12/8 21:00
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/order/teacher")
@Api(tags = "讲师信息接口类")
public class TeacherController {

    @Autowired
    private ByTeacherNameService teacherNameService;

    @ApiOperation(value = "根据讲师名字查询讲师信息")
    @ApiImplicitParams(
            {
                    @ApiImplicitParam(value = "讲师姓名", name = "teacherName")
            }
    )
    @PostMapping("queryAllTeacherByTeacherName/{teacherName}")
    public Result<EduTeacher> queryAllTeacherByTeacherName(@PathVariable String teacherName){
        return teacherNameService.findByTeacherName(teacherName);
    }
}
